package com.biz.primus.management.order.degraded;

import com.biz.primus.management.order.feign.GeoFeignClient;
import com.biz.primus.model.geo.vo.AreaResponseVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.LinkedList;
import java.util.List;

/**
 * @author zzy
 * @rema
 * @date 2017/11/14/009
 */
@Component
@Slf4j
public class DegradedGeoFeignClient implements GeoFeignClient {

    /**
     * 获取所有省份
     * @return
     */
    @Override
    public List<AreaResponseVo> findAllProvince() {
        List<AreaResponseVo> responseVoList = new LinkedList<>();
        for (int i = 1; i < 8; i++) {
            AreaResponseVo areaResponseVo = new AreaResponseVo();
            areaResponseVo.setId(Long.valueOf(i));
            areaResponseVo.setName("省会"+i);
            responseVoList.add(areaResponseVo);
        }
        return responseVoList;
    }

    @Override
    public List<AreaResponseVo> findCitiesByProvinceId(Long provinceId) {
        List<AreaResponseVo> responseVoList = new LinkedList<>();
        for (int i = 81; i < 88; i++) {
            AreaResponseVo areaResponseVo = new AreaResponseVo();
            areaResponseVo.setId(Long.valueOf(i));
            areaResponseVo.setName("城市"+i);
            responseVoList.add(areaResponseVo);
        }
        return responseVoList;
    }

    @Override
    public List<AreaResponseVo> findDistrictsByCityId(Long cityId) {
        List<AreaResponseVo> responseVoList = new LinkedList<>();
        for (int i = 181; i < 188; i++) {
            AreaResponseVo areaResponseVo = new AreaResponseVo();
            areaResponseVo.setId(Long.valueOf(i));
            areaResponseVo.setName("区/县"+i);
            responseVoList.add(areaResponseVo);
        }
        return responseVoList;
    }
}
